package com.miao.aop01;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

public class AopTest01 {

    @Test
    public void test01(){
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(AopConfig1.class);
        //打印容器里面的全部Bean的名字
        Arrays.stream(applicationContext.getBeanDefinitionNames()).forEach(System.out::println);
        System.out.println("############### 以上是全部Bean ######################\n");

        IUserService userService = (IUserService)applicationContext.getBean("userServiceImpl");
        userService.add();
    }
}
